// import {
// 	silentLogin
// } from '@/api/app';
// import {
// 	isWeixinClient,
// 	currentPage,
// 	trottle
// } from './tools'
// import store from '@/store'
// import Cache from './cache'
// import {
// 	BACK_URL,
// 	INVITE_CODE
// } from '@/config/cachekey'
// import {bindSuperior} from '@/api/user'
// import wechath5 from './wechath5'
// import {router} from '@/router'

// 获取登录凭证（code）

export function getWxCode() {
	return new Promise((resolve, reject) => {
		uni.login({
			success(res) {
				console.log(res)
				resolve(res.code);
			},

			fail(res) {
				reject(res);
			}

		});
	});
}
//小程序获取用户信息
export function getUserProfile() {
	return new Promise((resolve, reject) => {
		uni.getUserProfile({
			desc: '获取用户信息，完善用户资料 ',
			success: (res) => {
				console.log(res)
				resolve(res);
			},
			fail(res) {}

		})
	})

}
